<div class="layui-container">
    <div class="layui-row">
        <div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
			<div class="widget-head">
				<div class="widget-title">栏目</div>
			</div>
			<div class="widget-body layui-col-sm12 layui-col-md12 layui-col-lg12">
				<div class="layui-col-sm12 layui-col-md6 layui-col-lg6">
					<div class="layui-form-item">
							<div class="">
								{if !empty($column_pid) }
									<a class="layui-btn"
								   		href="{:url('setting/columnadziedit',['column_pid' => $column_pid])}">
								{else/}
									<a class="layui-btn"
									   href="{:url('setting/columnadedit',['column_pid' => $column_pid])}">
								{/if}
									<span class="mdi menu-icon mdi-plus"></span> 新增
								</a>
							</div>
					</div>
				</div>
				<div class="layui-col-md12" >
					<table width="100%" class="layui-table">
						<thead>
						<tr>
							<th>ID</th>
							<th>栏目名称</th>
							<th>排序</th>
							<th>添加时间</th>
							<th>操作</th>
						</tr>
						</thead>
						<tbody>
						{if (!$list->isEmpty())}
						  {volist name="list" id="item"}
								<tr>
									<td class="layer-text-middle">{$item['column_id']}</td>
									<td class="layer-text-middle">{$item['column_name']}</td>
									<td class="layer-text-middle">{$item['vip']}</td>
									<td class="layer-text-middle">
									
									{$item['create_time']|date="Y-m-d H:i"}</td>
									<td class="layer-text-middle">
										<div class="tpl-table-black-operation">

											{if !empty($column_pid) }
											<a href="{:url('setting/columnadziedit',
												['column_id' => $item['column_id'],'column_pid' => $column_pid])}">
											{else/}
												<a href="{:url('setting/columnadedit',
												['column_id' => $item['column_id']])}">
											{/if}



												<i class="mdi menu-icon mdi-pencil"></i> 编辑
											</a>
											{if empty($column_pid) }
											<a href="{:url('setting/columnad',
												['column_pid' => $item['column_id']])}">
												<i class="mdi menu-icon mdi-pencil"></i> 子分类
											</a>
											{/if}

											<a href="javascript:;" class="item-delete tpl-table-black-operation-del"
											   data-id="{$item['column_id']}">
												<i class="mdi menu-icon mdi-delete-forever"></i> 删除
											</a>
										</div>
									</td>
								</tr>
							{/volist}
						{else/}
							<tr>
								<td colspan="12" class="layer-text-center">暂无记录</td>
							</tr>
						{/if}
						</tbody>
					</table>
				</div>
				<div class="layui-col-lg12">
					<div class="layer-fr">{$list|raw} </div>
					<div class="layer-fr pagination-total layer-margin-right">
						<div class="layer-vertical-align-middle">总记录：{$list->total()}</div>
					</div>
				</div>
			</div>
        </div>
    </div>
</div>
<script>
    $(function () {

        // 删除元素
        var url = "{:url('setting/columnaddelete')}";
				$('.item-delete').delete('id', url,'','Columnad');

    });
</script>

